package com.sxpi.zixun.service.adminrole;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sxpi.zixun.bo.AdminRoleBo;
import com.sxpi.zixun.pojo.AdminRole;
import com.sxpi.zixun.service.BaseService;
import com.sxpi.zixun.vo.AdminRoleVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author: 董伟豪
 * @Date: 2022/8/25 11:02
 */
public interface IAdminRoleService extends IService<AdminRole>, BaseService {

    /**
     * 查询全部角色
     * @return
     */
    List<AdminRoleBo> findAdminRoleList();

    /**
     * 查询后台角色管理列表信息并分页
     * @param adminRoleVo
     * @return
     */
    IPage<AdminRoleBo> findAdminRolePage(AdminRoleVo adminRoleVo);

    /**
     * 保存和修改后台角色管理
     * @param adminrole
     * @return
     */
    AdminRoleBo saveUpdateAdminRole(AdminRole adminrole);

    /**
     * 根据后台角色管理id删除后台角色管理
     * @param id
     * @return
     */
    int deleteAdminRoleById(Long id);

    /**
     * 查询角色对应的权限
     * @param roleId
     * @return
     */
    List<String> findPermissionByRoleId(Long roleId);

    /**
     * 删除角色对应的权限
     * @param roleId
     * @return
     */
    // int deletePermissionByRoleId(Long roleId);

    /**
     * 给角色授权
     * @param roleId
     * @param permissionIds
     * @return
     */
    Boolean savePermissionByRoleId(Long roleId,String permissionIds);

}
